#ifndef STORESCPTHREAD_H
#define STORESCPTHREAD_H

#include <QThread>
#include "dcmtk/ofstd/ofcond.h"
#include "dcmtk/dcmnet/assoc.h"
struct T_ASC_Network;
struct T_ASC_Association;
struct T_DIMSE_Message;
class DcmFileFormat;
class StudyRecord;
class DcmAssociationConfiguration;

class StoreScpThread : public QThread
{
    Q_OBJECT
public:
    explicit StoreScpThread(QObject *parent = 0);

    void run();
    void setAbort(bool yes) { abort = yes; }

signals:
    void imageReceived(const QString &msg);

public slots:

private:
    bool abort;
    OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg);
    OFCondition processCommands(T_ASC_Association * assoc);
    OFCondition echoSCP( T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID);
    OFCondition storeSCP(T_ASC_Association *assoc, T_DIMSE_Message *msg, T_ASC_PresentationContextID presID);
};

#endif // STORESCPTHREAD_H
